<template>
    <view class="box">
    	<view class="title">
    		{{info.detail.cur.title}}
    	</view>
		
		<view class="xmt32 xflex-x" >
			<view class="xflex-x " style="margin-right: 130rpx;">
				<image class="yj" src="/static/image/icon_yj.png" mode=""></image>
				<view class="sz">
					{{info.detail.cur.views}}
				</view>
			</view>
			<view class="xflex-x ">
				<image class="yj" src="/static/image/icon_rl.png" mode=""></image>
				<view class="sz">
					{{info.detail.cur.createtime_text}}
				</view>
			</view>
		</view>
		
		<view class="xmt50">
			 <u-parse :content="info.detail.cur.content"></u-parse>
		</view>
		
		
		<view class="next" v-if="info.detail.pre.length  != 0">
			<view class="nextTitle">
				上一篇文章
			</view>
			<view class="nextbox" @click="detail(info.detail.pre.id)">
				<view class="xm24">
					{{info.detail.pre.title}}
				</view>
				<view class="xflex-x xm24" style="margin-right: 130rpx;">
					<image class="yj" src="/static/image/icon_yj.png" mode=""></image>
					<view class="sz">
						{{info.detail.pre.views}}
					</view>
				</view>
			</view>
		</view>
		
		<view class="xmt32 " v-if="info.detail.next.length  != 0">
			<view class="nextTitle">
				下一篇文章
			</view>
			<view class="nextbox" @click="detail(info.detail.next.id)">
				<view class="xm24">
					{{info.detail.next.title}}
				</view>
				<view class="xflex-x xm24" style="margin-right: 130rpx;">
					<image class="yj" src="/static/image/icon_yj.png" mode=""></image>
					<view class="sz">
						{{info.detail.next.views}}
					</view>
				</view>
			</view>
		</view>
    </view>
</template>

<script setup>
import {
    onReachBottom,
    onShow,
    onLoad
} from '@dcloudio/uni-app';
import {reactive, ref} from "vue"
let test = ref("测试1")
import {getNoticeDetail} from "@/network/home.js"

// 获取公告详情
let info = reactive({
	id:'',
	detail:{}
})

const detail = async(id) =>{
	let res = await getNoticeDetail({id:id})
	info.detail = res.data
}



onLoad((option)=>{
	info.id = option.id
	detail(option.id)
})
</script>

<style lang="scss">
	
	.box {
		padding: 63rpx 29rpx;
	}
	.title{
		font-size: 36rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: #111111;
		line-height: 40rpx;
	}
	
	.yj {
		width: 32rpx;
		height: 32rpx;
		margin-right: 13rpx;
		
	}
	
	.sz {
		font-size: 26rpx;
		font-weight: 400;
		color: #999999;
	}
	
	.next {
		margin-top: 157rpx;
		
	}
	.nextTitle {
		font-size: 24rpx;
		font-family: Microsoft YaHei;
		font-weight: 300;
		color: #333333;
		line-height: 32rpx;
	}
	.nextbox{
		width: 690rpx;
		height: 110rpx;
		background: #F8F8F8;
	}
</style>
